﻿using System;
using System.Reflection;

namespace FastData.Mapping
{
    internal class DataPropertyInfo
    {
        internal string Name;
        internal Type PropertyType;
        internal Type GenericType;
        internal bool IsNullableType;

        private PropertyInfo _propertyInfo;

        internal DataPropertyInfo(PropertyInfo propertyInfo)
        {
            _propertyInfo = propertyInfo;

            Name = propertyInfo.Name;
            PropertyType = propertyInfo.PropertyType;
            IsNullableType = PropertyType.IsNullableType();
            if (IsNullableType)
            {
                GenericType = PropertyType.GenericTypeArguments[0];
            }
        }
    }
}
